package cl.paperless.core.asp.online.ws.proxy;

import java.rmi.RemoteException;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.xml.rpc.ServiceException;

import pe.com.rimac.portal.common.ws.AbstractPortProxy;
import cl.paperless.core.asp.online.ws.Online;
import cl.paperless.core.asp.online.ws.OnlineLocator;
import cl.paperless.core.asp.online.ws.OnlinePortType;

public class OnlineProxy extends AbstractPortProxy implements OnlinePortType 
{
	/**
	 * @see cl.paperless.core.asp.online.ws.OnlinePortType#main(java.lang.String[])
	 */
	@Override
	public void main(String[] args) throws RemoteException 
	{
		((OnlinePortType) getPort()).main(args);
	}

	/**
	 * @see cl.paperless.core.asp.online.ws.OnlinePortType#onlineRecovery(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.Integer)
	 */
	@Override
	public String onlineRecovery(String ruc, String login, String clave,
			Integer tipoDoc, String folio, Integer tipoRetorno)
			throws RemoteException 
	{
		return ((OnlinePortType) getPort()).onlineRecovery(ruc, login, clave, tipoDoc, folio, tipoRetorno);
	}

	/**
	 * @see cl.paperless.core.asp.online.ws.OnlinePortType#onlineGeneration(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer)
	 */
	@Override
	public String onlineGeneration(String ruc, String login, String clave,
			String docTxt, Integer tipoFoliacion, Integer tipoRetorno)
			throws RemoteException 
	{
		return ((OnlinePortType) getPort()).onlineGeneration(ruc, login, clave, docTxt, tipoFoliacion, tipoRetorno);
	}

	/**
	 * @see cl.paperless.core.asp.online.ws.OnlinePortType#onlineRecoveryRec(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.Integer)
	 */
	@Override
	public String onlineRecoveryRec(String ruc, String login, String clave,
			String rucEmisor, Integer tipoDoc, String folio, Integer tipoRetorno)
			throws RemoteException 
	{
		return ((OnlinePortType) getPort()).onlineRecoveryRec(ruc, login, clave, rucEmisor, tipoDoc, folio, tipoRetorno);
	}

	/**
	 * @see cl.paperless.core.asp.online.ws.OnlinePortType#onlineARC(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.Integer, java.lang.String)
	 */
	@Override
	public String onlineARC(String ruc, String login, String clave,
			String rucEmisor, Integer tipoDoc, String folio, Integer estado,
			String version) throws RemoteException 
	{
		return ((OnlinePortType) getPort()).onlineARC(ruc, login, clave, rucEmisor, tipoDoc, folio, estado, version);
	}

	/**
	 * @see cl.paperless.core.asp.online.ws.OnlinePortType#cargaInformeBajas(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
	 */
	@Override
	public String cargaInformeBajas(String ruc, String login, String clave,
			String docTxt, String periodo) throws RemoteException 
	{
		return ((OnlinePortType) getPort()).cargaInformeBajas(ruc, login, clave, docTxt, periodo);
	}

	/**
	 * @see cl.paperless.core.asp.online.ws.OnlinePortType#onlineRecoveryRecList(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
	 */
	@Override
	public String onlineRecoveryRecList(String ruc, String login, String clave,
			String fecha) throws RemoteException 
	{
		return ((OnlinePortType) getPort()).onlineRecoveryRecList(ruc, login, clave, fecha);
	}
	
	/**
	 * @see pe.com.rimac.portal.common.ws.AbstractPortProxy#lookupLocator()
	 */
	@Override
	protected Object lookupLocator() throws ServiceException 
	{
		return new OnlineLocator().getOnlineSOAP11Port_http();
	}
	
	/**
	 * @see pe.com.rimac.portal.common.ws.AbstractPortProxy#lookupJndi(javax.naming.InitialContext)
	 */
	@Override
	protected Object lookupJndi(InitialContext ctx) throws NamingException,
			ServiceException 
	{
		return ((Online)ctx.lookup("java:comp/env/service/OnlineSOAP11port_http")).getOnlineSOAP11Port_http();
	}
}